Why PYQT5 connecting multiple checkboxes does not work in a loop but works by writing out everything